package com.ruoyi.apm.controller;

import com.ruoyi.apm.service.DockDataConfigService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: youguoen
 * Date: 2024/1/6
 */
@RestController
@RequestMapping("commonApi")
public class CommonApiController {

    @Autowired
    private DockDataConfigService dockDataConfigService;

    @GetMapping("getFormatDate")
    public AjaxResult getFormatDate(String format,String unit,Integer step){
        if(StringUtils.isEmpty(format)||StringUtils.isEmpty(unit)||StringUtils.isNull(step)){
            return AjaxResult.error("失败");
        }
        return AjaxResult.success(dockDataConfigService.getFormatDate(format,unit,step));
    }
}
